package com.hksj.ecm.controller;

import com.hksj.common.core.model.Rest;
import com.hksj.ecm.dto.EnergyTrendAnalysisDTO;
import com.hksj.ecm.service.EnergyTrendAnalysisService;
import com.hksj.ecm.vo.EnergyTrendAnalysisVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zengke
 * @version 1.0
 * @see EnergyTrendAnalysisController
 * @since 2024/08/17 14:24
 */

@Api(tags = "能耗监测-能耗趋势分析")
@RequestMapping("/api/energyTrendAnalysis")
@RestController
public class EnergyTrendAnalysisController {

    @Autowired
    private EnergyTrendAnalysisService energyTrendAnalysisService;

    @PostMapping(value = "/queryEnergyTrendAnalysis")
    @ApiOperation(value = "查询能耗趋势")
    public Rest<EnergyTrendAnalysisVO> queryEnergyTrendAnalysis(@RequestBody @Validated EnergyTrendAnalysisDTO energyTrendAnalysisDTO){
        EnergyTrendAnalysisVO energyTrendAnalysisVO = energyTrendAnalysisService.queryEnergyTrendAnalysis(energyTrendAnalysisDTO);
        return Rest.ok(energyTrendAnalysisVO);
    }
}
